package net.towee.client.widgets.upload;

import com.google.gwt.event.shared.GwtEvent;

public class UploadEvent extends GwtEvent<UploadHandler> {

	/**
	 * Event type for click events. Represents the meta-data associated with
	 * this event.
	 */
	private static final Type<UploadHandler> TYPE = new Type<UploadHandler>();
	private final String rawId;

	/**
	 * Gets the event type associated with click events.
	 * 
	 * @return the handler type
	 */
	public static Type<UploadHandler> getType() {
		return TYPE;
	}

	public UploadEvent(String rawId) {
		this.rawId = rawId;
	}

	@Override
	public final Type<UploadHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(UploadHandler handler) {
		handler.onUploaded( rawId );
	}

}